package com.anycc.cloud.gateway.service.feign;

import com.anycc.cloud.gateway.service.feign.fallback.RolePermissionFallbackImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * find full permission string by role name
 */
@FeignClient(value = "anycc-core", fallback = RolePermissionFallbackImpl.class)
public interface RolePermissionService {

    /**
     * 根据角色名获取完整权限字符串
     *
     * @param roleNames 角色名称
     * @return 权限字符串集合
     */
    @PostMapping("menu/findFullPermissionString")//此处使用Post方式，是因为当参数是非基本类型或String时会讲GET方式改为POST导致405错误
    List<String> findFullPermissionString(@RequestParam("roleNames") List<String> roleNames);
}
